import re

a = 'a45b7d23x95'
# print(re.sub(r'\d', 'T', 'a45b7d23x95'))
# print(re.sub(r'\d+', 'T', 'a45b7d23x95'))

def test(x):
	# print(f'x={x}')
	data = x.group()
	return str(int(data) * 2)


print(re.sub(r'\d+', test, a))
print(re.sub(r'\d+', lambda x: str(int(x.group())*2), a))